package com.itheima.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.itheima.dao.CourRespsitory;
import com.itheima.domain.Courier;
import com.itheima.service.CourierService;
@Service

public class CourServiceImpl implements CourierService {

	@Autowired
	private CourRespsitory courResitory;
	@Override
	@Transactional
	public void save(Courier courier) {
		// TODO Auto-generated method stub
		courResitory.save(courier);
	}
	@Override
	public Page<Courier> findByPageData(Specification<Courier> specification,Pageable pageable) {
		// TODO Auto-generated method stub
		return courResitory.findAll(specification,pageable);
	}
	@Override
	public void delBatch(String[] strs) {
		// TODO Auto-generated method stub
		for (String id : strs) {
			Integer ids = Integer.parseInt(id);
			courResitory.updateDelTag(ids);
		}
	}

}
